import store from '@/store'

export default ({ request }) => ({
  /**
   * 获取全部桥梁
   * @returns 
   */
  GET_ALL_BRIDGE_LIST() {
    return request({
      url: "/budwk/smartlc/lc/bridgemng/list",
      method: "post",
      data: {pageNo: 1, pageSize: 100000},
    });
  },
  /**
   * 获取桥梁信息
   * @returns 
   */
  GET_BRIDGE_INFO() {
    return request({
      url: "/budwk/smartlc/lc/taskmng/bridgeInformation",
      method: "post",
    });
  },
  /**
   * 获取预制梁信息
   * @returns 
   */
  GET_PREBRIDGE_DETAIL(id) {
    return request({
      url: "/budwk/smartlc/lc/prebridgemng/get/" + id,
    });
  },
  /**
   * 获取预制梁信息
   * @returns 
   */
   GET_PREBRIDGE_TASK_LIST(preBridgeId) {
    return request({
      url: "/budwk/smartlc/lc/taskmng/prefabricatedBeamProgressQuery",
      data: {preBridgeId},
      method: "post",
    });
  },
  /**
   * 获取预制梁树形接口
   * @returns 
   */
  GET_PREBRIDGE_TREE() {
    let fieldId = store.state.user.userInfo.unitId
    return request({
      url: "/budwk/smartlc/lc/prebridgemng/tree",
      params: { fieldId }
    });
  },
  /**
   * 获取预制梁列表
   * @returns 
   */
  GET_PREBRIDGE_LIST(data) {
    return request({
      url: "/budwk/smartlc/lc/prebridgemng/list",
      method: "post",
      data: data,
    });
  },
});
